package gdut.imis.Utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;

/**
 * @Description 日期时间格式转换工具类
 * @Author JiaFu
 * @Date 2023/4/22 11:16
 */
public class DateFormatUtil {

    public static Date LocalDateTimeToDate(LocalDateTime time) throws ParseException {
        String format = time.format(DateTimeFormatter.ISO_DATE);
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Date date = simpleDateFormat.parse(format);
        return date;
    }
}
